/**
 * 
 */
//var btnList ,btnInput,btnView
var url= 'index.jsp?inc=./member1/';
function general(){//게시판에서 사용하는 공통 모듈
//	btnList = document.getElementById('btnList');
//	if(btnList !=null){
//		btnList.onclick =function(){
//			location.href = 'list.jsp';
//
//		}
//		
//	}
	if (document.getElementById('btnList') != null) {
		document.getElementById('btnList').onclick = function() {
			var frm = document.hiddenFrm;
			frm.action = url+'list.jsp'
			frm.submit();
		}
	}
	if (document.getElementById('btnInput') != null) {
		document.getElementById('btnInput').onclick = function() {
			var frm = document.hiddenFrm;
			frm.action = url+'input.jsp'
			frm.submit();
		}
	}
	if (document.getElementById('btnModify') != null) {
		document.getElementById('btnModify').onclick = function() {
			location.href = url+'modify.jsp';
		}
	}
	if (document.getElementById('btnDelete') != null) {
		document.getElementById('btnDelete').onclick = function() {
			var b = confirm("삭쩨크 ??!!");
			if (b) {
				var rno = document.hiddenFrm.rno.value;
				location.href = url + "delete_result.jsp?rno="+rno;
			} else {
				alert("삭쩨크ㅊㅅ");
			}
		}
	}
	if (document.getElementById('btnView') != null) {
		document.getElementById('btnView').onclick = function() {
			location.href =url+'view.jsp';
		}
	}
	if (document.getElementById('btnSave') != null) {
		document.getElementById('btnSave').onclick = function() {
			location.href = url+'modify_result.jsp';
		}
	}

	
	
}
function goPage(page){
	
	//location.href=url+'view.jsp&page='+page;
	
	var mf = document.hiddenFrm;
	mf.nowPage.value = page;
	mf.find.value = document.member_list_frm.find.value;
	mf.action = 'index.jsp?inc=./member1/list.jsp';
	mf.submit();
	
}
function goView(page,rno){
	var mf = document.hiddenFrm;
	mf.nowPage.value = page;
	mf.rno.value = rno;
	mf.find.value = document.member_list_frm.find.value;
	mf.action = 'index.jsp?inc=./member1/view.jsp';
	mf.submit();
	
}


function inputInit(){// input과 관련되 모듈
	general();
	document.getElementById('btnSave').onclick=function(){
		var f= document.frm;
		if(f.mid.value==''){
			
			alert('아이디 입력해라');
			f.mid.focus();
		}else{
			f.submit();
		}
		
	}
}
function listInit(){
	general();
	goPage(page);
}
function viewInit(){
	general();

}
function modifyInit(){
	general();
	document.getElementById('btnSave').onclick=function(){
		var f= document.frm;
		if(f.mid.value==''){
			alert('아이디 입력해라');
			f.mid.focus();
		}else{
			f.submit();
		}
		
	}

}
function deleteInit(){
	
	general();

}